import { baseRequestClient, requestClient } from '#/api/request';

// 查询计费标准
export async function getChargeStandardApi(
  page: number,
  limit: number,
  query: object,
) {
  console.log(query);
  return requestClient.get(`/ChargeSystem/SFGL/findJFBZList`, {
    params: {
      page,
      limit,
      ...query,
    },
  });
}
// 新增计费标准
export async function addChargeStandardApi(data: any) {
  return requestClient.post('/ChargeSystem/SFGL/addJFBZ', data);
}
// 修改计费标准
export async function updateChargeStandardApi(data: any) {
  return requestClient.post('/ChargeSystem/SFGL/updateJFBZ', data);
}
// 删除计费标准
export async function deleteChargeStandardApi(jfbzID: any, regionID: any) {
  return requestClient.get(
    `/ChargeSystem/SFGL/deleteJFBZ?jfbzID=${jfbzID}&regionID=${regionID}`,
  );
}
// 查询计费标准是否被使用
export async function getChargeStandardIsUseApi(jfbzID: any) {
  return requestClient.post('/ChargeSystem/SFGL/getCountByJFBZID', jfbzID);
}
// 查询计费标准机构
export async function getChargeStandardOrgApi() {
  return requestClient.post('/ChargeSystem/SFGL/getcomNameLevel5');
}
// 查询计费标准是否被使用
export async function getChargeStandardIsUseByOrgApi(jfbzID: any) {
  return requestClient.post(
    `/ChargeSystem/SFGL/getCountByJFBZID?jfbzID=${jfbzID}`,
  );
}
// 查询修改计费标准
export async function getChargeStandardUpdateApi(jfbzID: any) {
  return requestClient.post(
    `/ChargeSystem/SFGL/getJFBZDiscountInfo?jfbzID=${jfbzID}`,
  );
}
// 获取子公司
export async function getSubCompanyApi() {
  return baseRequestClient.post('/ChargeSystem/person/companyTree');
}
// 复用计费标准
export async function getReuseChargeStandardApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/copyJFBZ`, data);
}
// 计费标准列表
export async function getChargeStandardListApi(year: string) {
  return requestClient.get(
    `/ChargeSystem/SFGL/findJFBZListByJfbzID?year=${year}`,
  );
}
// 生成热费
export async function generateHeatFeeApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/generateHeatingFee`, data);
}
// 按查询条件删除热费
export async function deleteHeatFeeApi(data: any) {
  return requestClient.get(`/ChargeSystem/SFGL/delHeatFeeByYsrfIds`, {
    params: {
      ...data,
    },
  });
}
// 删除热费
export async function deleteHeatFeeByQueryApi(data: any) {
  return requestClient.get(`/ChargeSystem/SFGL/delHeatFeeByCondition`, {
    params: {
      ...data,
    },
  });
}
// 搜索热费
export async function searchHeatFeeApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/getHouseAreaYSRFTable`, data);
}
// 搜索热费2
export async function searchHeatFee2Api(data: any) {
  return requestClient.post(
    `/ChargeSystem/SFGL/getHouseAreaYSRFTableByDel`,
    data,
  );
}
// 查询住户面积热费信息
export async function getHouseAreaYSRFTableApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/getHouseAreaYSRF`, data);
}
// 修改名字
export async function updateNameApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/updateHolderName`, data);
}
// 获取缴费信息
export async function getPayInfoApi(areaID: number, year: number) {
  return requestClient.get(
    `/ChargeSystem/SFGL/getHouseAreaYSRFByAreaIDAndYear?areaID=${areaID}&year=${year}`,
  );
}
// 查询缴费记录
export async function getPayRecordApi(areaID: number, year: number) {
  return requestClient.post(
    `/ChargeSystem/SFGL/getPayFeeRecordsByAreaIDAndYear?areaID=${areaID}&year=${year}`,
  );
}
// 已收查询
export async function getPayRecordListApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/getReceivedPayBySaveFee`, data);
}
// 开具发票
export async function getInvoiceApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/addInvoiceBySaveFee`, data);
}
// 查看发票
export async function getInvoiceListApi(data: any) {
  return requestClient.post(
    `/ChargeSystem/SFGL/getInvoiceDetailByPayfeeID`,
    data,
  );
}
// 查询账户余额
export async function getAccountBalanceApi(areaID: any) {
  return requestClient.post(
    `/ChargeSystem/SFGL/getPrepayAmountMoney?areaID=${areaID}`,
  );
}
// 提交缴费
export async function submitPayApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/savePayFee`, data);
}
// 修改违约金
export async function updatePenaltyApi(data: any) {
  return requestClient.post(
    `/ChargeSystem/SFGL/addLateFeeDerateBySaveFee`,
    data,
  );
}
// 查询房间详情
export async function getRoomDetailApi(areaID: any) {
  return requestClient.get(
    `/ChargeSystem/SFGL/getAreaDetailByAreaID?areaID=${areaID}`,
  );
}
// 修改房间详情
export async function updateRoomDetailApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/updateAreaDetail`, data);
}
// 应收或违约金减免
export async function getReceivableOrDerateApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/getDerateBySaveFee`, data);
}
// 停供信息
export async function getStopSupplyApi(data: any) {
  return requestClient.post(
    `/ChargeSystem/SFGL/getHeatingStateStopBySaveFee`,
    data,
  );
}
// 开票信息
export async function getInvoiceInfoApi(data: any) {
  return requestClient.post(
    `/ChargeSystem/SFGL/getInvoiceDetailBySaveFee`,
    data,
  );
}
// 单独红冲页面
export async function getRedChargeApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/getRedFlushFeeRecord`, data);
}
// 冲账收费
export async function getChargeApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/operationRedFlush`, data);
}
// 单独退费页面
export async function getRefundApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/getRefundFeeRecord`, data);
}
// 退费提交
export async function submitRefundApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/saveRefund`, data);
}
// 退费记录
export async function getRefundRecordApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/getRefundRecord`, data);
}
// 单独已收查询
export async function getReceivedPayApi(data: any) {
  return requestClient.post(
    `/ChargeSystem/SFGL/getReceivedPayByCondition`,
    data,
  );
}
// 查看发票
export async function getInvoiceDetailApi(data: any) {
  return requestClient.get(
    `/ChargeSystem/SFGL/getInvoiceDetailByFeeID?feeID=${data}`,
  );
}
// 单独发票管理
export async function getInvoiceManageApi(data: any) {
  return requestClient.post(
    `/ChargeSystem/SFGL/getInvoiceDetailByCondition`,
    data,
  );
}
// 单独费用减免
export async function getDerateApi(data: any) {
  return requestClient.post(
    `/ChargeSystem/SFGL/getReductionYSRFByCondition`,
    data,
  );
}
// 查看应收减免
export async function getDerateListApi(data: any) {
  return requestClient.post(
    `/ChargeSystem/SFGL/getDerateByAreaIDAndYear`,
    data,
  );
}
// 离线热费查询
export async function getOfflineHeatFeeApi(data: any) {
  return requestClient.post(
    `/ChargeSystem/SFGL/getNotPayFeeHeatOrdersByCondition`,
    data,
  );
}
// 离线热费导出列表查询
export async function getOfflineHeatFeeListApi(data: any) {
  return requestClient.post(
    `/ChargeSystem/SFGL/exportPayFeeHeatOrdersByCondition`,
    data,
  );
}
// 离线热费到处历史查询
export async function getOfflineHeatFeeHistoryApi(
  pageNo: number,
  pageSize: number,
  levels: number,
) {
  return requestClient.post(
    `/ChargeSystem/fee/findExportHistory?pageNo=${pageNo}&pageSize=${pageSize}&levels=${levels}`,
  );
}
// 离线热费导入(面积)
export async function importOfflineHeatFeeApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/savePayFeeData`, data);
}
// 离线热费导入(计量)
export async function importOfflineHeatFee2Api(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/saveMeterPayFeeData`, data);
}
// 离线热费导入记录查询
export async function getOfflineHeatFeeImportRecordApi(data: any) {
  return requestClient.post(`/ChargeSystem/SFGL/getImportFeeFileRecord`, data);
}
// 离线热费导入记录删除
export async function delOfflineHeatFeeImportRecordApi(id: number) {
  return requestClient.post(
    `/ChargeSystem/SFGL/delImportFeeFileRecord?id=${id}`,
  );
}
// 预收款账户管理查询
export async function getPreAccountApi(data: any) {
  return requestClient.post(`/ChargeSystem/receive/findAdvancePayment`, data);
}
// 按选择生成预收款账户
export async function createPreAccountApi(houseID: any) {
  return baseRequestClient.get(
    `/ChargeSystem/receive/findVillageInfo?houseID=${houseID}`,
  );
}
// 删除预收款账户
export async function delPreAccountApi(id: any) {
  return baseRequestClient.post(`/ChargeSystem/receive/deleteAdvance?id=${id}`);
}
// 充退款操作
export async function chargeRefundApi(data: any) {
  return baseRequestClient.post(`/ChargeSystem/receive/updateRecharge`, data);
}
// 退款记录查询
export async function getRefundRecordApi2(data: any) {
  return baseRequestClient.post(
    `/ChargeSystem/receive/findRechargeHistory`,
    data,
  );
}
// 包干小区查询
export async function getVillageApi(data: any) {
  return baseRequestClient.post(
    `/ChargeSystem/SFGL/getImportFeeLumpRecord`,
    data,
  );
}
// 包干小区导入
export async function importVillageApi(data: any) {
  return baseRequestClient.post(`/ChargeSystem/SFGL/importFeeLumpRecord`, data);
}
// 包干小区导入历史查询
export async function getVillageImportHistoryApi(data: any) {
  return baseRequestClient.post(
    `/ChargeSystem/SFGL/getImportFeeLumpFileRecord`,
    data,
  );
}
// 包干小区导出
export async function exportVillageApi(data: any) {
  return baseRequestClient.post(`/ChargeSystem/SFGL/exportImportFeeLump`, data);
}
// 包干小区导出历史查询
export async function getVillageExportHistoryApi(
  pageNo: number,
  pageSize: number,
  levels: number,
) {
  return baseRequestClient.get(`/ChargeSystem/fee/findExportHistory`, {
    params: {
      pageNo,
      pageSize,
      levels,
    },
  });
}
//催费推送查询
export async function getUrgePaymentApi(data: any) {
  return baseRequestClient.post(
    `/ChargeSystem/SFGL/getUrgePaymentDataList`,
    data,
  );
}
// 催费推送历史查询
export async function getHistoryPaymentApi(data: any) {
  return baseRequestClient.post(
    `/ChargeSystem/SFGL/getUrgePaymentMsgData`,
    data,
  );
}
// 催费选中推送
export async function getSelectedPaymentApi(data: any) {
  return baseRequestClient.post(
    `/ChargeSystem/SFGL/sendUrgePaymentByHouseIDs`,
    data,
  );
}
// 催费按条件推送
export async function getConditionPaymentApi(data: any) {
  return baseRequestClient.post(
    `/ChargeSystem/SFGL/sendUrgePaymentByCondition`,
    data,
  );
}
// 查询模版名称
export async function getTelmplateName(comId: any, templateType: any) {
  return baseRequestClient.get(
    `/ChargeSystem/SFGL/getMsgTemplateDataList?comId=${comId}&templateType=${templateType}`,
  );
}
// 催费历史导出
export async function getHistoryExportPaymentApi(data: any) {
  return baseRequestClient.post(
    `/ChargeSystem/SFGL/exportUrgePaymentMsg`,
    data,
  );
}
// 催费导出历史
export async function getPaymentHistory(
  pageNo: number,
  pageSize: number,
  levels: number,
) {
  return baseRequestClient.get(`/ChargeSystem/fee/findExportHistory`, {
    params: {
      pageNo,
      pageSize,
      levels,
    },
  });
}
// 查询热源修改记录
export async function getHeatSourceChangeRecordApi(data: any) {
  return baseRequestClient.post(
    `/ChargeSystem/khzywh/getHeatSourceReport`,
    data,
  );
}
// 查询换热站修改记录
export async function getHeatExchangeStationChangeRecordApi(data: any) {
  return baseRequestClient.post(
    `/ChargeSystem/khzywh/getHeatExchangeStationReport`,
    data,
  );
}
// 查询小区修改记录
export async function getVillageChangeRecordApi(data: any) {
  return baseRequestClient.post(
    `/ChargeSystem/khzywh/getVillageReport`,
    data,
  );
}
//查询住户修改记录
export async function getHouseholdChangeRecordApi(data: any) {
  return baseRequestClient.post(
    `/ChargeSystem/khzywh/getHouseDetailReport`,
    data,
  );
}
// 查询面积修改记录
export async function getAreaChangeRecordApi(data: any) {
  return baseRequestClient.post(`/ChargeSystem/khzywh/getAreaDetailReport`, data);
}
